//发送请求

import config from "./config";
export default (url, data = {}, method = 'GET') => {
    return new Promise((resolve, reject)=>{
        wx.request({
            url:config.host+url,
            data,
            method,
            success(res) {
                console.log('success:', res)
                resolve(res.data);
            },

            fail(res) {
                console.log('fail:', res)
                reject(res);
            }
        })
    })
}